<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>后台管理登录</title>
    <meta name="description" content="with selectable items(single &amp; multiple) and custom icons" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link href="/css/login-admin.css" rel="stylesheet" />
    <script src="/js/jquery.min.js"></script>
</head>
<script>
    function login_form(){
        var url = $('#login').attr('action');
        var user_name  = $('#login input[name="user_name"]').val();
        var password = $('#login input[name="password"]').val();
        $.post(url,{user_name:user_name,password:password},function(xhr){
            if(xhr.status){
                location.href = xhr.url;
            }else{
                $('#login span[node-type="span-password"]').html(xhr.info);
                $('#login span[node-type="span-password"]').show();
            }
        })
    }
</script>
<body>


<form id="login" action="{:U('User/Login')}"  method="post">
    <h1>Log In</h1>
    <fieldset id="inputs">
        <input id="username" name="user_name" type="text" placeholder="Username" autofocus required>
        <input id="password" name="password" type="password" placeholder="Password" required>
        <span class="help-inline" node-type="span-password" style="display: none;color: red;"></span>
    </fieldset>
    <fieldset id="actions">
        <input type="button" id="submit" value="Log in" onclick="javascript:login_form();">
        <a href="">Forgot your password?</a>
    </fieldset>
</form>
<br><br>
</body>
</html>